package com.qf.dao.caiwu_dao;

import com.qf.bean.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface AccountMapper {
    int deleteByPrimaryKey(Integer aid);

    int insert(Account record);

    int insertSelective(Account record);

    Account selectByPrimaryKey(Integer aid);

    int updateByPrimaryKeySelective(Account record);

    int updateByPrimaryKey(Account record);

    //查询账目信息列表
    List<Account> findAccountList(Map map);

    //审核
    @Update("update account set check_state='已审核' where aid=#{aid}")
    int checkStateToChecked(@Param("aid") Integer aid);

    //确认
    @Update("update account set trade_state='已确认' where aid=#{aid}")
    int tradeStateToAffirm(@Param("aid")Integer aid);

    //根据itemID删除信息
    void deleteByItemId(@Param("itemId") Integer itemId);

    //查询被选中id的用户信息
    List<Account> findByIds(Integer[] aid);

    //批量删除
    int deleteChecked(Integer[] aid);
}